<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
	<head>
		<link rel="stylesheet" type="text/css" href="css/tabsheets.css" />
		<link rel="stylesheet" type="text/css" href="css/header.css" />
		<script type="text/javascript" src="javascript/tabsheets.js"></script>
	</head>
<body>

<!-- HEADER-BEGIN -->
<table id="header">
	<tr>
		<td id="logo">
			<div align="center">
				<table id="epam" >
					<tr>
						<td><span id="title">EPAM Training Portal</span></td>
						<td align=center>
							<!--    A   U   T   O   R   I   Z   E   D    A   D   M   I   N   -->
								<table id="login_table"><tr><td id="title_little">	
								Welcome, <s:property value="session.user.firstName"/> 
										 <s:property value="session.user.lastName"/>!
								&nbsp;&nbsp;&nbsp;&nbsp;
								<s:url action="logout" id="url"/>
								<s:a href="%{url}">LogOut</s:a>
								</td></tr></table>
							<!----------------------------------------------------------------->
						</td>
					</tr>
				</table>
			</div>	
		</td>
	</tr>
	<tr>
		<td>
			<div align="center">
				<table id="table-menu">
					<tr>
						<td>
							<div id="css-menu">
								<ul>
									<li><a href="<s:url action='index'/>">Home</a></li>
									<li><a href="<s:url action='trainers-list'/>">Trainers</a></li>
								</ul>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>
<!-- HEADER-END -->

<!-- CONTENT-BEGIN -->
<div align=center>
	<div style="padding:0em;display:block;width:90%;">
		<table id="table-register-70">
			<tr align=center><th>Trainer Name</th><th>Discipline</th><th>Email</th><th>Is Active</th><th>Action</th></tr>
			<s:iterator value="lectorList" var="item" status="stat">
				<tr>
				<td>
					<s:url action="view-trainer" id="url"/>
					<s:a href="%{url}?id=%{#item.id}">
						<s:property value="#item.fullName"/>
					</s:a>
				</td>
				<td>
					<select name="course">
						<s:iterator value="courseList" var="it" status="status">
							<option value='<s:property value="#status.index"/>' <s:property value="#status.index eq #item.course.id?'selected':''"/>>
								<s:property value="#it"/>
							</option>						
						</s:iterator>
					</select>
				</td>
				<td><s:property value="#item.login"/></td>
				<td align=center>
					<s:checkbox value="#item.isActive" name="check%{#item.id}" disabled="true"/>
				</td>
				<td align="center">
					<s:if test="#item.isActive">
						<s:url action="mark-inactive" id="url"/>
						<s:a href="%{url}?id=%{#item.id}">MarkInActive</s:a>
					</s:if>
					<s:else>
						<s:url action="mark-active" id="url"/>
						<s:a href="%{url}?id=%{#item.id}">MarkActive</s:a>
					</s:else>
				</td>
				</tr>
			</s:iterator>
		</table>	
		<p align="center">
			<s:form action="add-trainer">
			<s:date name="date"/>
			<s:submit value="Add New Trainer"/>
		</s:form>
		</p>
	</div>
</div>

<!-- CONTENT-END -->

</body>
</html>